<?php
USE_PAGE('index');

class PageInscription extends Page
	{
	protected function build()
		{
		$f = $this->add(new Pages_Html('MTM'));
		$f->setFilter('f_status=1 and f_menu_id=1');

		$d = $this->add(new Bills_customers_login('LOGIN'));
		if( Params::hasParam(0) )
			Bills_customers_login::afterLogin(Params::getParam(0));
		else
			Bills_customers_login::afterLogin('/mon-compte');
		$d = $this->add(new Bills_customers_public('MYINSC'));
		$d->buildForm('INSC');
		}

	public function handleEvent( $event, $source, $params ) {parent::handleEvent( $event, $source, $params );}

	protected function _process( $processor = null, $ret = false )
		{
		$ret = parent::_process( $processor, $ret );
		if($ret && (isset($_POST['form_name']) && strtoupper($_POST['form_name'])=='INSC'))
			{
			header('Location:/mon-compte');
			die();
			}
		return $ret;
		}
		
	protected function getPageUrl() { return '/inscription'; }
	protected function getBreadcrumbTitle() { return 'Identification / Inscription'; }
	protected function getPageParent() { return 'PageIndex'; }
	}
?>